import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';

import PropTypes from 'prop-types';
import { SafeAreaView } from 'react-navigation';
import Items from '../components/items';
import BaseStyle from '../constants/Style';

export default class Origin extends Component {
  static propTypes = {
    navigation: PropTypes.object,
  };

  // static defaultProps = {

  // };
  constructor(props) {
    super(props);
  }

  componentDidMount = () => {};

  componentWillUnMount = () => {};

  render() {
    const {
      navigation: { navigate },
    } = this.props;
    return (
      <SafeAreaView
        style={[BaseStyle.flex, styles.homebg]}
        forceInset={{ top: 'never' }}>
        <View style={styles.container}>
          {/* list */}
          <Items
            LeftText={'热更新'}
            RightIcon={'\ue615'}
            onPress={() => {
              navigate('Web', {
                uri: 'https://github.com/Microsoft/react-native-code-push',
                title: 'code-push',
              });
            }}
          />
          <Items
            LeftText={'推送'}
            RightIcon={'\ue615'}
            onPress={() => {
              toast('推荐极光推送,或其他原生端集成');
            }}
          />
          <Items
            LeftText={'百度统计'}
            RightIcon={'\ue615'}
            onPress={() => {
              navigate('Web', {
                uri: 'https://www.jianshu.com/p/7a753532830d',
                title: '百度统计',
              });
            }}
          />
          <Items
            LeftText={'友盟统计'}
            RightIcon={'\ue615'}
            onPress={() => {
              navigate('Web', {
                uri: `https://jslinlink.gitee.io/blog/2018/08/31/react-native-%E5%8F%8B%E7%9B%9F%E7%BB%9F%E8%AE%A1-IOS-%E7%AB%AF%E9%9B%86%E6%88%90/`,
              });
            }}
          />

          <Items
            LeftText={'手势，指纹等'}
            RightIcon={'\ue615'}
            onPress={() => {
              toast('敬请期待-_-');
            }}
          />
        </View>
      </SafeAreaView>
    );
  }
}

const styles = StyleSheet.create({
  homebg: {
    backgroundColor: '#eee',
  },
  container: {
    ...BaseStyle.flex,
    paddingTop: 20,
  },
});
